/*
 * Copyright 2013 JROSE
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.jrose.test.mock;

import lombok.Data;
import org.jrose.api.annotation.persistence.Column;
import org.jrose.api.annotation.persistence.CreateTimestamp;
import org.jrose.api.annotation.persistence.PrimaryKey;
import org.jrose.api.annotation.persistence.Revision;
import org.jrose.api.annotation.persistence.Table;
import org.jrose.api.annotation.persistence.UpdateTimestamp;

import java.io.Serializable;
import java.util.Date;

@Data
@Table("MOCK_MAGZINE")
public class MockMagzine implements Serializable {
    private static final long serialVersionUID = -2814276077793869603L;

    @PrimaryKey(autoInc = true) private Long id;
    @CreateTimestamp(name = "CREATETIME") private Date createTime;
    @UpdateTimestamp(name = "UPDATETIME") private Long updateTime;
    @Revision private Long revision;
    @Column(notNull = true) private String name;
    @Column(defaultValue = @Column.DefaultValue("0.0")) private Double price;

    public MockMagzine() {
    }

    public MockMagzine(String name) {
        this.name = name;
    }
}
